<?php
class Sfs_View_Helper_ClassGradeOptions
{
	function ClassGradeOptions($selected='')
	{
	    $locale = Bootstrap::$config['resources']['locale']['default'];
        $path = APPLICATION_PATH."/modules/semester/languages/$locale/class.php";
        $tr = Zend_Registry::get('Zend_Translate');
        $tr->addTranslation($path);

		// 取得預設年段資料
		$view = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->view;
		$arr =  unserialize(($view->School['length_name']));

		$str = '';
		foreach ($arr as $id=>$val) {
			if ($selected == $id)
			$str .='<option value="'.$id.'" selected>'.$val.$tr->translate('grade unit').'</option>'."\n";
			else
			$str .='<option value="'.$id.'">'.$val.$tr->translate('grade unit').'</option>'."\n";
		}
		return $str;
	}
}
